package com.baixun.gasentity.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@ApiModel(value = "SysLawEnforcementVideo对象", description = "执法仪视频记录表")
@TableName("sys_law_enforcement_video")
public class SysLawEnforcementVideo implements Serializable {

    @TableId
    @ApiModelProperty(value = "主键ID")
    private Long id;

    @ApiModelProperty(value = "执法仪ID")
    private Long lawDeviceId;

    @ApiModelProperty(value = "设备名称")
    @TableField("device_name")  // 指定数据库中的字段名
    private String deviceName;

    @ApiModelProperty(value = "开始时间")
    @TableField("start_time")   // 指定数据库中的字段名
    private LocalDateTime startTime;

    @ApiModelProperty(value = "结束时间")
    @TableField("end_time")     // 指定数据库中的字段名
    private LocalDateTime endTime;

    @ApiModelProperty(value = "文件大小（GB）")
    @TableField("size_gb")      // 用于映射数据库查询中的 size_gb 字段
    private Double sizeGb;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    // 计算字段，不映射到数据库
    @ApiModelProperty(value = "每天的视频总大小（GB）")
    @TableField(exist = false)
    private Double totalSizeInGB;



    @ApiModelProperty(value = "每天的视频总数量")
    @TableField(exist = false)
    private Integer totalCount;

    public SysLawEnforcementVideo() {
    }

    public SysLawEnforcementVideo(Long id, Long lawDeviceId, String deviceName, LocalDateTime startTime, LocalDateTime endTime, Double sizeGb, LocalDateTime createTime, LocalDateTime updateTime, Double totalSizeInGB, Integer totalCount) {
        this.id = id;
        this.lawDeviceId = lawDeviceId;
        this.deviceName = deviceName;
        this.startTime = startTime;
        this.endTime = endTime;
        this.sizeGb = sizeGb;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.totalSizeInGB = totalSizeInGB;
        this.totalCount = totalCount;
    }
}
